package com.sh.data.engine.domain.datadev.offline.model.enums;

import java.util.List;
import java.util.Objects;

/**
 * @Author: zigui.zdf @Date: 2022/2/21 18:02:22 @Description:
 */
public enum OfflineDevTopNodeIdEnum {
    TASK("1", "作业开发"),
    TASK_FLOW("2", "工作流程"),
    RESOURCE("3", "资源管理"),
    FUNCTION("4", "函数管理"),
    OPERATION("5", "任务运维");

    String id;

    String name;

    public static final OfflineDevTopNodeIdEnum[] VALUES;

    static {
        VALUES = values();
    }

    OfflineDevTopNodeIdEnum(String id, String name) {
        this.id = id;
        this.name = name;
    }

    public String getId() {
        return id;
    }

    public String getName() {
        return name;
    }

    public static OfflineDevTopNodeIdEnum of(String id) {
        for (OfflineDevTopNodeIdEnum nodeTypeEnum : VALUES) {
            if (Objects.equals(nodeTypeEnum.id, id)) {
                return nodeTypeEnum;
            }
        }
        return null;
    }

    public static List<String> getTopNodeIds() {
        List<String> ids = List.of(TASK.id, TASK_FLOW.id, RESOURCE.id, FUNCTION.id, OPERATION.id);
        return ids;
    }
}
